import base from './baseapi'
import wepy from 'wepy';
import Tips from '../utils/Tips';


/**
 * 收货地址，主页API接口数据
 */

 export default class addressapi extends base {
     static async GetMemberAddress(params) {
         let res = await this.get('vshop', 'Address/GetMemberAddress', params);
         return res;
     }

     static async AddWeixinAddress(params) {
        let res = await this.postForm('vshop', 'Address/AddWeixinAddress', params);
        return res;
    }

    static async GetBaseAddress(params) {
        let res = await this.get('vshop', 'Address/GetBaseAddress', params);
        return res;
    }

    static async AddAddress(params) {
        let res = await this.postForm('vshop', 'Address/AddAddress', params);
        return res;
    }

    ///弹出地图，添加收货地址
    static async AddMapAddress(params) {
        let res = await this.postForm('vshop', 'Address/AddMapAddress', params);
        return res;
    }
    
    static async GetMemberAddressById(params) {
        let res = await this.get('vshop', 'Address/GetMemberAddressById', params);
        return res;
    }

    static async DeleteAddress(params) {
        let res = await this.postJson('vshop', 'Address/DeleteAddress', params);
        return res;
    }

    static async UpdateAddress(params) {
        let res = await this.postForm('vshop', 'Address/UpdateAddress', params);
        return res;
    }

    ///高德地址编码匹配地址库信息
    static async GetMapPcdInfo(params) {
        let res = await this.get('vshop', 'Address/GetMapPcdInfo', params);
        return res;
    }

    ///这个是用来更新通过地图定位的收货地址信息
    static async UpdateMapAddress(params) {
        let res = await this.postForm('vshop', 'Address/UpdateMapAddress', params);
        return res;
    }

 }